package com.study.web.entity;

import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

import com.study.common.base.entity.BaseEntity;

/**
 * @ZhName:系统用户实体类
 * @table:sys_user
 * @author:yaojinshan
 * @createTime:2017-06-11 10:47
 */
public class SysUser extends BaseEntity {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
     * 登陆名
     */
	@NotEmpty(message = "登陆名不能为空")
	@Size(max = 20, min = 3)
	@Pattern(regexp = "^[a-zA-Z0-9_\\.]+$", message = "请输入字母和数字_ . ")
    private String loginName;
    /**
     * 登录密码
     */
	@NotEmpty(message = "登录密码不能为空")
	@Size(max = 30, min = 6)
	@Pattern(regexp = "^[a-zA-Z0-9_\\.]+$", message = "请输入字母和数字_ . ")
    private transient String password;
    /**
     * 登陆时间
     */
    private Date loginTime;
    /**
     * 上次登陆ip
     */
    private String loginIp;
    /**
     * 上次登陆时间
     */
    private Date lastLoginTime;
    /**
     * 真实姓名
     */
    @NotEmpty(message = "真实姓名不能为空")
	@Size(max = 10, min = 2)
	@Pattern(regexp = "^[\u2E80-\u9FFF]+$", message = "真实姓名只能为汉字")
    private String realName;
    /**
     * 创建人Id
     */
    private Long createrId;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 更新人id
     */
    private Long updaterId;
    /**
     * 所属部门id
     */
    private Long dapartmentId;
    /**
     * 角色id
     */
    @NotNull(message = "所属角色不能为空")
    private Long roleId;
    /**
     * 组织机构id
     */
    private String orgId;
    /**
     * 是否删除 0 不删除 1 删除
     * */
    public Integer isDelete=0;
    /**
     * 状态 1 可用 2 冻结
     */
    private Integer status=2;
    /**
     * 联系地址
     */
    private String address;
    /**
     * 联系电话
     */
    private String telephone;
    /**
     * 手机号
     */
    private String mobilePhone;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 邮政编码
     */
    private String zipCode;
    /**
     * 备注
     */
    private String remark;
    /**
     * 所属银行Id
     */
    private String bankId;
    /**
     * 父级银行Id路径
     */
    private String fullBankId;
    /**
     * 操作员的银行Id
     */
    private String opBankId;
    private String openId;//微信号
    /**
	 * @param user
	 */
	public SysUser(SysUser user) {
		
	}
	/**
	 * 
	 */
	public SysUser() {
	}
	public String getLoginName() {
        return loginName;
    }
    public void setLoginName(String loginName) {
        this.loginName = loginName == null ? null : loginName.trim();
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }
    public Date getLoginTime() {
        return loginTime;
    }
    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }
    public String getLoginIp() {
        return loginIp;
    }
    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp == null ? null : loginIp.trim();
    }
    public Date getLastLoginTime() {
        return lastLoginTime;
    }
    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }
    public String getRealName() {
        return realName;
    }
    public void setRealName(String realName) {
        this.realName = realName == null ? null : realName.trim();
    }
    public Long getCreaterId() {
        return createrId;
    }
    public void setCreaterId(Long createrId) {
        this.createrId = createrId;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Long getUpdaterId() {
        return updaterId;
    }
    public void setUpdaterId(Long updaterId) {
        this.updaterId = updaterId;
    }
    public Long getDapartmentId() {
        return dapartmentId;
    }
    public void setDapartmentId(Long dapartmentId) {
        this.dapartmentId = dapartmentId;
    }
    public Long getRoleId() {
        return roleId;
    }
    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }
    public String getOrgId() {
        return orgId;
    }
    public void setOrgId(String orgId) {
        this.orgId = orgId == null ? null : orgId.trim();
    }
    public Integer getIsDelete() {
        return isDelete;
    }
    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address == null ? null : address.trim();
    }
    public String getTelephone() {
        return telephone;
    }
    public void setTelephone(String telephone) {
        this.telephone = telephone == null ? null : telephone.trim();
    }
    public String getMobilePhone() {
        return mobilePhone;
    }
    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone == null ? null : mobilePhone.trim();
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }
    public String getZipCode() {
        return zipCode;
    }
    public void setZipCode(String zipCode) {
        this.zipCode = zipCode == null ? null : zipCode.trim();
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }
    public String getBankId() {
		return bankId;
	}
	public void setBankId(String bankId) {
		this.bankId = bankId;
	}
	public String getFullBankId() {
		return fullBankId;
	}
	public void setFullBankId(String fullBankId) {
		this.fullBankId = fullBankId;
	}
	public String getOpBankId() {
		return opBankId;
	}
	public void setOpBankId(String opBankId) {
		this.opBankId = opBankId;
	}
	public String getOpenId() {
		return openId;
	}
	public void setOpenId(String openId) {
		this.openId = openId;
	}
	/**
     * @return String
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(getId());
        sb.append(", loginName=").append(loginName);
        sb.append(", password=").append(password);
        sb.append(", loginTime=").append(loginTime);
        sb.append(", loginIp=").append(loginIp);
        sb.append(", lastLoginTime=").append(lastLoginTime);
        sb.append(", realName=").append(realName);
        sb.append(", createrId=").append(createrId);
        sb.append(", createTime=").append(getCreateTime());
        sb.append(", updateTime=").append(updateTime);
        sb.append(", updaterId=").append(updaterId);
        sb.append(", dapartmentId=").append(dapartmentId);
        sb.append(", roleId=").append(roleId);
        sb.append(", orgId=").append(orgId);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", status=").append(status);
        sb.append(", address=").append(address);
        sb.append(", telephone=").append(telephone);
        sb.append(", mobilePhone=").append(mobilePhone);
        sb.append(", email=").append(email);
        sb.append(", zipCode=").append(zipCode);
        sb.append(", remark=").append(remark);
        sb.append(", bankId=").append(bankId);
        sb.append(", fullBankId=").append(fullBankId);
        sb.append(", opBankId=").append(opBankId);
        sb.append(", openId=").append(openId);
        sb.append("]");
        return sb.toString();
    }
}